home *** CD-ROM | disk | FTP | other *** search
- /*
- HyperXCmd.h Definitions for calling all standard
- HyperCard callback routines from C.
- ©Apple Computer, Inc. 1987
- All Rights Reserved.
-
- See CFlash.C for an example of how to include this module in your
- C program.
- */
-
-
- typedef struct XCmdBlock {
- short paramCount;
- Handle params[16];
- Handle returnValue;
- Boolean passFlag;
-
- void (*entryPoint)(); /* to call back to HyperCard */
- short request;
- short result;
- long inArgs[8];
- long outArgs[4];
- } XCmdBlock, *XCmdBlockPtr;
-
- typedef struct Str31 {
- char guts[32];
- } Str31, *Str31Ptr;
-
- /*result codes */
- #define xresSucc 0
- #define xresFail 1
- #define xresNotImp 2
-
- /* request codes */
- #define xreqSendCardMessage 1
- #define xreqEvalExpr 2
- #define xreqStringLength 3
- #define xreqStringMatch 4
- #define xreqSendHCMessage 5
- #define xreqZeroBytes 6
- #define xreqPasToZero 7
- #define xreqZeroToPas 8
- #define xreqStrToLong 9
- #define xreqStrToNum 10
- #define xreqStrToBool 11
- #define xreqStrToExt 12
- #define xreqLongToStr 13
- #define xreqNumToStr 14
- #define xreqNumToHex 15
- #define xreqBoolToStr 16
- #define xreqExtToStr 17
- #define xreqGetGlobal 18
- #define xreqSetGlobal 19
- #define xreqGetFieldByName 20
- #define xreqGetFieldByNum 21
- #define xreqGetFieldByID 22
- #define xreqSetFieldByName 23
- #define xreqSetFieldByNum 24
- #define xreqSetFieldByID 25
- #define xreqStringEqual 26
- #define xreqReturnToPas 27
- #define xreqScanToReturn 28
- #define xreqScanToZero 39 /* was suppose to be 29! Oops! */
-
-
- /* Forward definitions of glue routines. Main program
- must include XCmdGlue.inc.c. See XCmdGlue.inc.c for
- documentation of each routine. */
- typedef void (*MyProcPtr) ();
-
- pascal void SendCardMessage(paramPtr,msg)
- XCmdBlockPtr paramPtr; StringPtr msg; extern;
- pascal Handle EvalExpr(paramPtr,expr)
- XCmdBlockPtr paramPtr; StringPtr expr; extern;
- pascal long StringLength(paramPtr,strPtr)
- XCmdBlockPtr paramPtr; StringPtr strPtr; extern;
- pascal Ptr StringMatch(paramPtr,pattern,target)
- XCmdBlockPtr paramPtr; StringPtr pattern;
- Ptr target; extern;
- pascal void SendHCMessage(paramPtr,msg)
- XCmdBlockPtr paramPtr; StringPtr msg; extern;
- pascal void ZeroBytes(paramPtr,dstPtr,longCount)
- XCmdBlockPtr paramPtr; Ptr dstPtr;
- long longCount; extern;
- pascal Handle PasToZero(paramPtr,pasStr)
- XCmdBlockPtr paramPtr; StringPtr pasStr; extern;
- pascal void ZeroToPas(paramPtr,zeroStr,pasStr)
- XCmdBlockPtr paramPtr; char *zeroStr;
- StringPtr pasStr; extern;
- pascal long StrToLong(paramPtr,strPtr)
- XCmdBlockPtr paramPtr; Str31 * strPtr; extern;
- pascal long StrToNum(paramPtr,str)
- XCmdBlockPtr paramPtr; Str31 * str; extern;
- pascal Boolean StrToBool(paramPtr,str)
- XCmdBlockPtr paramPtr; Str31 * str; extern;
- pascal void StrToExt(paramPtr,str,myext)
- XCmdBlockPtr paramPtr; Str31 * str;
- extended * myext; extern;
- pascal void LongToStr(paramPtr,posNum,mystr)
- XCmdBlockPtr paramPtr; long posNum;
- Str31 * mystr; extern;
- pascal void NumToStr(paramPtr,num,mystr)
- XCmdBlockPtr paramPtr; long num;
- Str31 * mystr; extern;
- pascal void NumToHex(paramPtr,num,nDigits,mystr)
- XCmdBlockPtr paramPtr; long num;
- short nDigits; Str31 * mystr; extern;
- pascal void BoolToStr(paramPtr,bool,mystr)
- XCmdBlockPtr paramPtr; Boolean bool;
- Str31 * mystr; extern;
- pascal void ExtToStr(paramPtr,myext,mystr)
- XCmdBlockPtr paramPtr; extended * myext;
- Str31 * mystr; extern;
- pascal Handle GetGlobal(paramPtr,globName)
- XCmdBlockPtr paramPtr; StringPtr globName; extern;
- pascal void SetGlobal(paramPtr,globName,globValue)
- XCmdBlockPtr paramPtr; StringPtr globName;
- Handle globValue; extern;
- pascal Handle GetFieldByName(paramPtr,cardFieldFlag,fieldName)
- XCmdBlockPtr paramPtr; Boolean cardFieldFlag;
- StringPtr fieldName; extern;
- pascal Handle GetFieldByNum(paramPtr,cardFieldFlag,fieldNum)
- XCmdBlockPtr paramPtr; Boolean cardFieldFlag;
- short fieldNum; extern;
- pascal Handle GetFieldByID(paramPtr,cardFieldFlag,fieldID)
- XCmdBlockPtr paramPtr; Boolean cardFieldFlag;
- short fieldID; extern;
- pascal void SetFieldByName(paramPtr,cardFieldFlag,fieldName,fieldVal)
- XCmdBlockPtr paramPtr; Boolean cardFieldFlag;
- StringPtr fieldName; Handle fieldVal; extern;
- pascal void SetFieldByNum(paramPtr,cardFieldFlag,fieldNum,fieldVal)
- XCmdBlockPtr paramPtr; Boolean cardFieldFlag;
- short fieldNum; Handle fieldVal; extern;
- pascal void SetFieldByID(paramPtr,cardFieldFlag,fieldID,fieldVal)
- XCmdBlockPtr paramPtr; Boolean cardFieldFlag;
- short fieldID; Handle fieldVal; extern;
- pascal Boolean StringEqual(paramPtr,str1,str2)
- XCmdBlockPtr paramPtr; Str31 * str1;
- Str31 * str2; extern;
- pascal void ReturnToPas(paramPtr,zeroStr,pasStr)
- XCmdBlockPtr paramPtr; Ptr zeroStr;
- StringPtr pasStr; extern;
- pascal void ScanToReturn(paramPtr,scanHndl)
- XCmdBlockPtr paramPtr; Ptr * scanHndl; extern;
- pascal void ScanToZero(paramPtr,scanHndl)
- XCmdBlockPtr paramPtr; Ptr * scanHndl; extern;
-
-
-
-
-